Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix replaceChild parameter order #522

Merged
merged 1 commit into from
Feb 4, 2023
Merged

Conversation

ahti
Copy link
Contributor

@ahti ahti commented Oct 1, 2022

replaceChild expects the new child first, old child second (see MDN).

To observe this issue in action, take the sample code from #523 and add back the VStack wrapping the body for state a, then run and click the button. In Safari, this throws the following:

[Error] NotFoundError: The object can not be found here.
	replaceChild (index.mjs:280)
	swjs_call_function_with_this_no_catch (index.mjs:280)
	wasm-stub
	<?>.wasm-function[$s13JavaScriptKit27invokeNonThrowingJSFunction_9arguments4thisSo10RawJSValueaAA0G0C_SayAA013ConvertibleToK0_pGAA8JSObjectCSgtFAFSayAFGXEfU_AFSRyAFGXEfU_]
	<?>.wasm-function[$s13JavaScriptKit27invokeNonThrowingJSFunction_9arguments4thisSo10RawJSValueaAA0G0C_SayAA013ConvertibleToK0_pGAA8JSObjectCSgtFAFSayAFGXEfU_AFSRyAFGXEfU_TA]
	<?>.wasm-function[$sSRySo10RawJSValueaGABs5Error_pIgydzo_AcBsAD_pIegyrzo_TR]
	<?>.wasm-function[$sSRySo10RawJSValueaGABs5Error_pIgydzo_AcBsAD_pIegyrzo_TRTA]
	<?>.wasm-function[$sSa23withUnsafeBufferPointeryqd__qd__SRyxGKXEKlF]
	<?>.wasm-function[$s13JavaScriptKit27invokeNonThrowingJSFunction_9arguments4thisSo10RawJSValueaAA0G0C_SayAA013ConvertibleToK0_pGAA8JSObjectCSgtFAFSayAFGXEfU_]
	<?>.wasm-function[$s13JavaScriptKit27invokeNonThrowingJSFunction_9arguments4thisSo10RawJSValueaAA0G0C_SayAA013ConvertibleToK0_pGAA8JSObjectCSgtFAFSayAFGXEfU_TA]
	<?>.wasm-function[$sSa13JavaScriptKitAA20ConvertibleToJSValue_pRszlE15withRawJSValuesyqd__qd__SaySo0hF0aGXElF01_ghI0L_yqd0__SayAaB_pG_SiAFzqd0__AFXEtAaB_pRszr___lF]
	<?>.wasm-function[$sSa13JavaScriptKitAA20ConvertibleToJSValue_pRszlE15withRawJSValuesyqd__qd__SaySo0hF0aGXElF01_ghI0L_yqd0__SayAaB_pG_SiAFzqd0__AFXEtAaB_pRszr___lFqd0__AEXEfU_]
	<?>.wasm-function[$sSa13JavaScriptKitAA20ConvertibleToJSValue_pRszlE15withRawJSValuesyqd__qd__SaySo0hF0aGXElF01_ghI0L_yqd0__SayAaB_pG_SiAFzqd0__AFXEtAaB_pRszr___lFqd0__AEXEfU_TA]
	<?>.wasm-function[$s13JavaScriptKit7JSValueO07withRawD0yxxSo0fD0aXElF]
	<?>.wasm-function[$sSa13JavaScriptKitAA20ConvertibleToJSValue_pRszlE15withRawJSValuesyqd__qd__SaySo0hF0aGXElF01_ghI0L_yqd0__SayAaB_pG_SiAFzqd0__AFXEtAaB_pRszr___lF]
	<?>.wasm-function[$sSa13JavaScriptKitAA20ConvertibleToJSValue_pRszlE15withRawJSValuesyqd__qd__SaySo0hF0aGXElF01_ghI0L_yqd0__SayAaB_pG_SiAFzqd0__AFXEtAaB_pRszr___lFqd0__AEXEfU_]
	<?>.wasm-function[$sSa13JavaScriptKitAA20ConvertibleToJSValue_pRszlE15withRawJSValuesyqd__qd__SaySo0hF0aGXElF01_ghI0L_yqd0__SayAaB_pG_SiAFzqd0__AFXEtAaB_pRszr___lFqd0__AEXEfU_TA]
	<?>.wasm-function[$s13JavaScriptKit7JSValueO07withRawD0yxxSo0fD0aXElF]
	<?>.wasm-function[$sSa13JavaScriptKitAA20ConvertibleToJSValue_pRszlE15withRawJSValuesyqd__qd__SaySo0hF0aGXElF01_ghI0L_yqd0__SayAaB_pG_SiAFzqd0__AFXEtAaB_pRszr___lF]
	<?>.wasm-function[$sSa13JavaScriptKitAA20ConvertibleToJSValue_pRszlE15withRawJSValuesyqd__qd__SaySo0hF0aGXElF]
	<?>.wasm-function[$s13JavaScriptKit27invokeNonThrowingJSFunction_9arguments4thisSo10RawJSValueaAA0G0C_SayAA013ConvertibleToK0_pGAA8JSObjectCSgtF]
	<?>.wasm-function[$s13JavaScriptKit10JSFunctionC14callAsFunction4this9argumentsAA7JSValueOAA8JSObjectCSg_SayAA013ConvertibleToJ0_pGtF]
	<?>.wasm-function[$s13JavaScriptKit8JSObjectCyAA7JSValueOAA013ConvertibleToE0_pd_tcSgSScigAeaF_pd_tcfU_]
	<?>.wasm-function[$s13JavaScriptKit8JSObjectCyAA7JSValueOAA013ConvertibleToE0_pd_tcSgSScigAeaF_pd_tcfU_TA]
	<?>.wasm-function[$s10TokamakDOM16DOMFiberRendererV6commityySay0A4Core8MutationOyACGGF]
	<?>.wasm-function[$s10TokamakDOM16DOMFiberRendererV0A4Core05FiberD0AadEP6commityySayAD8MutationOyxGGFTW]
	<?>.wasm-function[$s11TokamakCore15FiberReconcilerC9reconcileyyF]
	<?>.wasm-function[$s11TokamakCore15FiberReconcilerC12fiberChangedyyAC0C0Cyx_GFyycfU_]
	<?>.wasm-function[$s11TokamakCore15FiberReconcilerC12fiberChangedyyAC0C0Cyx_GFyycfU_TA]
	<?>.wasm-function[$s13OpenCombineJS11JSSchedulerC8schedule7options_yAC16SchedulerOptionsVSg_yyctFyycfU_]
	<?>.wasm-function[$s13OpenCombineJS11JSSchedulerC8schedule7options_yAC16SchedulerOptionsVSg_yyctFyycfU_TA]
	<?>.wasm-function[$s13JavaScriptKit7JSTimerC17millisecondsDelay11isRepeating8callbackACSd_SbyyctcfcAA7JSValueOSayAHGcfU0_]
	<?>.wasm-function[$s13JavaScriptKit7JSTimerC17millisecondsDelay11isRepeating8callbackACSd_SbyyctcfcAA7JSValueOSayAHGcfU0_TA]
	<?>.wasm-function[$s13JavaScriptKit16JSOneshotClosureC_4file4lineAcA7JSValueOSayAGGc_SSs6UInt32VtcfcAgHcfU0_]
	<?>.wasm-function[$s13JavaScriptKit16JSOneshotClosureC_4file4lineAcA7JSValueOSayAGGc_SSs6UInt32VtcfcAgHcfU0_TA]
	<?>.wasm-function[$sSay13JavaScriptKit7JSValueOGACIeggo_AdCIegnr_TR]
	<?>.wasm-function[$sSay13JavaScriptKit7JSValueOGACIeggo_AdCIegnr_TRTA]
	<?>.wasm-function[$sSay13JavaScriptKit7JSValueOGACIegnr_AdCIeggo_TR]
	<?>.wasm-function[$sSay13JavaScriptKit7JSValueOGACIegnr_AdCIeggo_TRTA]
	<?>.wasm-function[$s13JavaScriptKit24_call_host_function_implySbs6UInt32V_SPySo10RawJSValueaGs5Int32VADtF]
	<?>.wasm-function[_call_host_function_impl]
	<?>.wasm-function[swjs_call_host_function]
	wasm-stub
	callHostFunction (index.mjs:404)

@carson-katri carson-katri added bug Something isn't working Fiber Changes related to the FiberReconciler or a FiberRenderer labels Oct 2, 2022
@gregcotten
Copy link
Contributor

@carson-katri what's it gonna take to merge this in?

@carson-katri
Copy link
Member

@ahti Is this superseded by #525?

@ahti
Copy link
Contributor Author

ahti commented Feb 4, 2023

While #525 does also contain this change, I think merging this as-is would be fine. Fixing the parameter order is a strict improvement imo and I did have a case or two where this was the only issue preventing them from working.

@carson-katri carson-katri merged commit e0d8e9d into TokamakUI:main Feb 4, 2023
@carson-katri
Copy link
Member

Ok, merged as-is. You'll probably get a conflict on #525 now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Fiber Changes related to the FiberReconciler or a FiberRenderer
Development

Successfully merging this pull request may close these issues.

3 participants